<script setup>
  import {onMounted,ref} from 'vue'
  import {getPageListApi} from '@/apis/message.js'

  const messageList = ref({})

  onMounted(()=>{
    getMessageList()
  })

  const getMessageList = async() => {
    const res = await getPageListApi({
    contentType:200,
    page:1,
    pageSize:5
  })
    messageList.value = res.data
  }
</script>
<template>
  <scroll-view class="scroll-view" refresher-enabled scroll-y>
    <view class="scroll-view-wrapper">
      <view class="message-action">
        <text class="iconfont icon-clear"></text>
        全部已读
      </view>
      <uni-list :border="false">
        <uni-list-item
        v-for="item in messageList.items"
        :key="item.id"
          :to="`/subpkg_message/content/index?id=${item.id}`"
          ellipsis="1"
          :title="item.title"
          :rightText="item.updated"
        >
          <template #header>
            <text class="dot"></text>
          </template>
        </uni-list-item>
        </uni-list>
      </view>
  </scroll-view>
</template>

<style lang="scss" scoped>
  @import './styles.scss';
</style>
